package com.example.waimaiandroid.login;

import androidx.lifecycle.LiveData;
import androidx.lifecycle.MutableLiveData;
import androidx.lifecycle.ViewModel;

import com.example.waimai.pojo.User;

public class LoginViewModel extends ViewModel {
    // 没用上呀
    MutableLiveData<String> UserName;
    MutableLiveData<String> Password;

    public LiveData<String> getUserName(){
        if( null == UserName){
            UserName = new MutableLiveData<>();
        }
        return UserName;
    }

    public LiveData<String> getPassword(){
        if( null == Password){
            Password = new MutableLiveData<>();
        }
        return Password;
    }

    // 清空数据
    public void onCleared(){
        super.onCleared();
        UserName = null;
        Password = null;
    }
}
